from django.shortcuts import render
from django.http import HttpResponse

from .. models import Order,OrderInfo
from django.contrib.auth.decorators import permission_required


#订单列表
def index(request):

    #获取订单数据
    ob = Order.objects.all()


    return render(request,'admin/dingdan/index.html',{'list':ob})


def edit(request):
    oid = request.GET['id']

    ob = Order.objects.get(id=oid)

    ob.status = 3
    ob.save()


    return HttpResponse('ok')